package com.travel.api.service.user

import com.github.pagehelper.PageInfo
import com.travel.api.beans.request.BaseRequest
import com.travel.api.beans.request.user.LoginRequest
import com.travel.api.beans.request.user.RegisterRequest
import com.travel.api.beans.user.SysUser
import org.springframework.web.bind.annotation.RequestHeader

import javax.servlet.http.HttpServletRequest

/**
 * @ClassName 用户Service
 * @Author liguangyao
 * @Date 13/8/18 下午3:20
 * @Version 1.0
 */
interface UserService {

    /**
     * 用户详情列表
     */
    fun list(request: BaseRequest): PageInfo<*>

    /**
     * 用户注册
     */
    fun register(request: RegisterRequest): Map<String, Any>

    /**
     * 用户登录
     * @param request
     * @return
     */
    fun login(request: LoginRequest, servletRequest: HttpServletRequest): Map<String, Any>

    /**
     * 检查Token有效性
     * @param token
     * @return
     */
    fun judgeToken(token: String): Boolean

    /**
     * 用户退出
     * @param token
     * @return
     */
    fun logout(token: String): Boolean

    /**
     * 用户查询
     * @param mobile
     * @return
     */
    fun getUserInfo(mobile: String): SysUser?
}
